<template>
  <el-dialog
    title="选择-配送方式"
    :visible.sync="dialogVisible"
    width="300px">
    <div>
      性别:
      <el-select v-model="sendType" style="width: 50%">
          <el-option :value="index" :key="index" :label="item" v-for="(item,index) in dict.OrderSendTypeArr"></el-option>
      </el-select>
    </div>
    <div slot="footer" class="dialog-footer">
      <el-button type="primary" @click="confirm">确认选择</el-button>
    </div>
  </el-dialog>

</template>

<script>
export default {
  name: 'ChooseSendTypeDialog',
  data: function () {
    return {
      callback:null,
      dialogVisible:false,
      sendType:0,
    }
  },
  mounted () {
    let $this = this
    $this.bus.$on('ChooseSendTypeDialogCallBus', function (sendType,callback) {
      $this.dialogVisible = true
      $this.callback=callback
      $this.sendType=sendType
      $this.$forceUpdate()
    })

  },
  methods: {
    confirm:function () {
      if (typeof this.callback==='function'){
        this.callback(this.sendType)
        this.dialogVisible = false
      }
    }
  }
}
</script>

<style scoped>

</style>
